package com.ihrm.employee.service;


import com.ihrm.domain.employee.UserCompanyPersonal;
import com.ihrm.domain.employee.response.EmployeeReportResult;
import com.ihrm.employee.dao.UserCompanyPersonalDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserCompanyPersonalService {

    @Autowired
    private UserCompanyPersonalDao userCompanyPersonalDao;
    
    public void save(UserCompanyPersonal personalInfo){
        userCompanyPersonalDao.save(personalInfo);
    }
    
    public UserCompanyPersonal findById(String uid){
        return userCompanyPersonalDao.findByUserId(uid);
    }
    
    public List<EmployeeReportResult> findByReport(String companyId,String month){
        return userCompanyPersonalDao.findByReport(companyId,month+"%");
    }
    
}
